<template>
  <div>
    <!-- 最上面 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>订单管理</el-breadcrumb-item>
      <el-breadcrumb-item>订单列表</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片视图区域 -->
    <el-card>
      <!-- 第一层搜索框和按钮 -->
      <!-- @clear="getUserList"这句话没加 -->
      <el-input placeholder="请输入内容" style="width: 400px" clearable>
        <el-button slot="append" icon="el-icon-search"></el-button>
      </el-input>
    </el-card>
  </div>
</template>

<script>
export default {
    data(){
        return {
            //获取列表要传递的参数
            orderParams: {
                query: '',
                pagenum: 1,
                pagesize: 12,
            }
        }
    },
    created() {
        this.getOrderList();
    },
    methods: {
        //获取订单列表
        await getOrderList(){
            const {data:res} = await this.$http.get('orders',{params: this.orderParams});
            if(res.meta.status !== 200){
                return this.$message.error('获取订单列表失败')
            }
            this.$message.success('获取订单列表成功');
            console.log(res.data);
        }
    }
};
</script>

<style lang="less"></style>
